#

| Chapter 33 Batch Editing |

## 33.12 Versions of awk

awk was introduced as part of UNIX's seventh edition and has been part of the standard distribution ever since.

In 1985, the authors of awk extended the language, adding many useful features. Unfortunately, this new version remained inside AT&T for several years. It became a regular part of AT&T's System V as of Release 3.1. It can be found under the name of nawk (for new awk); the older version still exists under its original name.

gawk | Unfortunately, nawk is not available on all systems. The good news is that the Free Software Foundation (52.9) GNU project's version of awk, called gawk, implements all the features of the new awk.

In general, you can assume that what is true for nawk is true for gawk, unless gawk is explicitly called out. Scripts written for nawk are 100 percent compatible with gawk. If you want to use one of the nawk scripts, and don't have nawk on your system, simply change the script to invoke gawk instead.

There are a few areas where gawk has introduced gawk-specific features; however, recent versions of nawk support many of these features, suggesting that the remaining differences are really very minor. This shouldn't matter in any case, since we do supply gawk on the disc.

This book doesn't cover any of the awks in detail. The recent awks, especially, have quite a few features in common - so documentation for any one of them should help you learn the others.

In this book, we show scripts for awk as well as scripts that only work on nawk and gawk. But we barely scratch the surface of all the awks' features. The completely revised second edition of O'Reilly & Associates' sed & awk has detailed information on all of them. [2] There's also lots of documentation on the CD-ROM. Take your pick.

> [2] And thanks to Arnold Robbins, co-author of the second edition, for his help with this section and other awk material in this book.

- JP, DD, TOR

33.11 Quick Reference: awk |  | 34. The sed Stream Editor